#!/usr/local/bin/perl
use Fcntl ':mode';
use Data::Dumper;
my @S = lstat($ARGV[0]);
my $mode = $S[2];
printf("real: %lo\n", $mode);
printf("mode: %lo\n", S_IMODE($mode));
printf("fmt : %lo\n", S_IFMT($mode));

printf("S_ISREG: %lo\n", S_ISREG($mode));
printf("S_ISDIR: %lo\n", S_ISDIR($mode));
printf("S_ISLNK: %lo\n", S_ISLNK($mode));
printf("S_ISBLK: %lo\n", S_ISBLK($mode));
printf("S_ISCHR: %lo\n", S_ISCHR($mode));
printf("S_ISFIFO: %lo\n", S_ISFIFO($mode));
printf("S_ISSOCK: %lo\n", S_ISSOCK($mode));

print Dumper(\@S);
